package com.dingding.common.core.config;

import org.apache.log4j.Logger;

/**
 * 
 * @ClassName: EmailConfig 
 * @Description: 邮件发送相关配置
 * @author CHEHAUNBO 
 * @date 2016年5月26日 下午2:05:58
 * 
 */
public class EmailConfig extends AbstractConfig {

	private Logger log = Logger.getLogger(EmailConfig.class);

	// 邮件发送环境 默认：生产环境
	private boolean env_email = true;

	// 邮件发送服务器地址
	private static final String EMAIL_HOST = Constants.EMAIL_HOST_NAME;

	// 发件箱 用户名
	private static final String EMAIL_OUTBOX_NAME = Constants.EMAIL_OUTBOX_NAME;
	// 发件箱 密码
	private static final String EMAIL_OUTBOX_PWD = Constants.EMAIL_OUTBOX_PWD;
	// 发件箱
	private static String OUTBOX = Constants.OUTBOX;
	// 收件箱 默认：保险公司提供邮箱
	private static String INBOX = Constants.INBOX_PRODUCE;

	/**
	 * 初始化配置
	 * @Title: intitalConfigValue 
	 * @author CHEHAUNBO
	 * 
	 */
	@Override
	public void intitalConfigValue() {

		boolean flag = prop.getBoolean("env_Email");
		if (!flag) { // 测试环境，重新赋值
			env_email = false;
			INBOX = Constants.INBOX_TEST;
		}
		log.info("正在初始化邮件发送配置！初始化后的值为：" + toString());

	}

	public static String getEMAIL_HOST() {
		return EMAIL_HOST;
	}

	public static String getEMAIL_OUTBOX_NAME() {
		return EMAIL_OUTBOX_NAME;
	}

	public static String getEMAIL_OUTBOX_PWD() {
		return EMAIL_OUTBOX_PWD;
	}

	public static String getOUTBOX() {
		return OUTBOX;
	}

	public static void setOUTBOX(String oUTBOX) {
		OUTBOX = oUTBOX;
	}

	public static String getINBOX() {
		return INBOX;
	}

	public static void setINBOX(String iNBOX) {
		INBOX = iNBOX;
	}

	public String toString() {
		return "环境：" + env_email + "[EMAIL_HOST]:" + EMAIL_HOST + "[EMAIL_OUTBOX_NAME]:" + EMAIL_OUTBOX_NAME
				+ "[EMAIL_OUTBOX_PWD]:" + EMAIL_OUTBOX_PWD + "[OUTBOX]:" + OUTBOX + "[INBOX]:" + INBOX;
	}

}
